import request from '@/utils/request'

export function fetchList(query) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/user/findAll2',
    method: 'get',
    params: query
  })
}

export function  es(searchname) {
  return request({
     baseURL: 'http://localhost:8886',
    url: '/user/es',
    method: 'get',
    params: { searchname }
  })
}

export function getExport() {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/user/export3',
    method: 'get'
  })
}

export function getUpdate(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/user/update2',
    method: 'post',
    data
  })
}

export function getCreate(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/user/add/admin',
    method: 'post',
    data
  })
}



export function getCreateUser(data) {
  return request({
    baseURL: 'http://localhost:8886',
    url: '/user/add',
    method: 'post',
    data
  })
}

export function  delAdmin(userName) {
  return request({
     baseURL: 'http://localhost:8886',
    url: '/user/auth/del',
    method: 'get',
    params: { userName}
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
